package com.yejiali.backend.controller;

import com.yejiali.backend.entity.dto.RegisterDTO;
import com.yejiali.backend.response.Response;
import com.yejiali.backend.service.RegisterService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:yejiali
 * @Date:2025/5/10-05-10-16:32
 * @Decsription:com.yejiali.backend.controller
 * @Version:1.0
 */
@RestController
@Tag(name = "登录注册管理", description = "用户登录注册接口")
public class RegisterController {
    @Autowired
    private RegisterService registerService;

    @PostMapping("/register")
    @Operation(summary = "用户注册接口", description = "注册用户信息")
    public Response register(@Validated @RequestBody RegisterDTO user) {
       return registerService.register(user);
    }
}
